﻿
@{
    ViewBag.Title = "Index";
}

@model Model.Content.Article

@RenderPage("~/Areas/EasyUI/Views/Shared/_EasyUI.cshtml")

<link href="/Scripts/EasyUI/Insdep/easyui.css" rel="stylesheet" />
<link href="/Scripts/EasyUI/Insdep/easyui_animation.css" rel="stylesheet" type="text/css">
<link href="/Scripts/EasyUI/Insdep/easyui_plus.css" rel="stylesheet" type="text/css">
<link href="/Scripts/EasyUI/Insdep/insdep_theme_default.css" rel="stylesheet" type="text/css">

<script src="/Scripts/UEditor/ueditor.config.js"></script>
<script src="/Scripts/UEditor/ueditor.all.js"></script>
<link href="/Scripts/UEditor/themes/iframe.css" rel="stylesheet" />
<script src="/Scripts/UEditor/lang/zh-cn/zh-cn.js"></script>

<style type="text/css">
    .combo-panel.panel-body.panel-body-noheader
    {
        height: 100% !important;
    }
</style>

<div id="theme-login-form">
    <form id="catetory" class="theme-login-form" method="post">
        <input type="hidden" id="addoredit" value="1" />
        @Html.AntiForgeryToken()
        <div class="easyui-panel" style="width: 80%; padding: 30px 60px;line-height: 30px">
            <input type="hidden" id="articleid" name="articleid" value="@Model.ArticleID" />

            <div style="margin-bottom: 20px">
                <label class="label-top">名称:</label>
                <input class="easyui-textbox theme-textbox-radius" name="title" id="title" value="@Model.Title" style="width: 100%;" data-options="required:true">
            </div>

            <div style="margin-bottom: 20px">
                <label class="label-top">作者:</label>
                <input class="easyui-textbox theme-textbox-radius" name="author" id="author" value="@Model.Author" style="width: 100%;" data-options="required:true">
            </div>

            <div style="margin-bottom: 20px;">
                <label>封面图:</label>
                <div>
                    <input type="hidden" name="images" id="hiddenimages" value="@Model.Images" />
                    <img type="image" src="@Model.Images" id="images" style="height: 50px; width: 50px" />
                </div> 
                <div style="clear: both"></div>
            </div>

            <div style="margin-bottom: 20px;">
                <label>是否显示:</label>
                <div style="width: 100%;border: 1px solid #ccc;padding: 10px 0 10px 0;">
                    <input type="radio" name="IsShow" value="1" checked="checked" style="margin-left:10px" />是
                    <input type="radio" name="IsShow" value="0" style="margin-left:10px" />否
                </div>
                <div style="clear: both"></div>
            </div>

            <div style="margin-bottom: 20px">
                <label class="label-top">文章类型:</label>
                <input type="hidden" id="categoryid" value="@Model.CategoryID" name="categoryid" />
                <select id="categoryselect" style="width: 100%;">
                    <option value="请选择">请选择</option> 
                </select>
            </div>

            <div style="margin-bottom: 20px">
                <label class="label-top">指定栏目:</label>
                <input type="hidden" id="columnid" value="@Model.ColumnID" name="columnid" />
                <select id="columnselect" style="width: 100%;">
                    <option value="请选择">请选择</option> 
                </select>
            </div>

            <div style="margin-bottom: 20px">
                <textarea id="details" name="details"></textarea>
            </div>

            <div style="margin-bottom: 20px">
                <input class="submit" type="submit" style="width: 48%; float: left" value="确认" />
                <a style="width: 48%; float: right" id="cancels" class="easyui-linkbutton button">取消</a>
            </div>

        </div>
    </form>
</div>

<form id="filesubmit" action="Image" method="post">
    @Html.AntiForgeryToken()
    <input type="file" id="imagesubmit" style="display:none" name="file" />
</form>

<script src="/Areas/EasyUI/Scripts/Admin/Content.js"></script>
<script type="text/javascript">
    $(function () { 
        var editor = UE.getEditor('details');
        editor.ready(function () {
            editor.execCommand('insertHtml', '@Html.Raw(Model.Details)');
        });

        if ('@Model.IsShow'==="1")
            $("input[name=IsShow]:eq(0)").attr("checked", 'checked');
        else
            $("input[name=IsShow]:eq(1)").attr("checked", 'checked');
    });
</script>